package com.atguigu.spzx.manager.controller;

import com.atguigu.spyx.model.common.Result;
import com.atguigu.spzx.manager.service.SysUserRoleService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author LT
 * @create 2023-11-06-19:05
 */
@RestController
@RequestMapping("/admin/system/userRole")
public class SysUserRoleController {

    @Resource
    SysUserRoleService sysUserRoleService;

    @PutMapping("/assignRoles2User/{userId}")
    public Result assignRoles2User(@PathVariable("userId")Long userId,
                                   @RequestBody List<Long> roleIds
    ){
        sysUserRoleService.assignRoles2User(userId,roleIds);
        return Result.ok();
    }


}
